<?php
namespace Home\Controller;
use Think\Controller;
use Memcached;

class BaseController extends Controller {
	public function __construct() {
		parent::__construct();
		header("Server: Golang 1.3", true);
		header("X-Powered-By: Golang 1.3");
		session('URL',__INFO__ );
		session_cache_limiter('public');

		if ( IS_WIN ) {
			C('SHOW_PAGE_TRACE',1);
			C('SHOW_RUN_TIME',1);
			C('DATA_CACHE_TYPE','file'); //本地环境使用文件缓存
		}

		if (isMobile()) {
			$imageLocation = 'http://c.cnzz.com/wapstat.php';
			$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
			$query = array();
			array_push($query, 'siteid=' . "1253161653" * 1);
			array_push($query, 'r=' . urlencode($referer));
			array_push($query, 'rnd=' . mt_rand(1, 2147483648));
			$imageUrl = $imageLocation . '?' . implode('&', $query);
			$cnzz =<<<END
<!-- Mobile --><img src="{$imageUrl}">
		<!--cnzz tui--><script  type="text/javascript" src="http://tui.cnzz.net/cs.php?id=1000084105"></script>
		<script type="text/javascript">var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Ffcb2f95cf9a4639a654ff805cc92ebfd' type='text/javascript'%3E%3C/script%3E"));</script>
		
END;
		} else {
			$cnzz =<<<END
<!-- PC --><script src="http://s13.cnzz.com/stat.php?id=1253161653&web_id=1253161653" language="JavaScript"></script>
		<!--cnzz tui--><script  type="text/javascript" c=gd  charset="utf-8"  src="http://tui.cnzz.net/cs.php?id=1000084107"></script>
		<script type="text/javascript">var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Ffcb2f95cf9a4639a654ff805cc92ebfd' type='text/javascript'%3E%3C/script%3E"));</script>

END;
		}
		$this->assign("cnzz", $cnzz);
		
	}
}